home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 1
/
Nebula One.iso
/
Financial
/
QTax1.1
/
Source
/
InverseObject.m
< prev
next >
Wrap
Text File
|
1995-06-12
|
1KB
|
64 lines
#import "InverseObject.h"
@implementation InverseObject
- Calc:sender
{
char dummyString[20];
float price;
float tps;
float subtotal;
float tvq;
float total;
total = [Total floatValue];
price = (total/1.13955);
tps = (price*.07);
subtotal = (price+tps);
tvq = (subtotal*0.065);
sprintf(dummyString, "$%.2f", price); // Convert float to a string
[Price setStringValue:dummyString];// Display result
[Price display];
sprintf(dummyString, "$%.2f", tps); // Convert float to a string
[TPS setStringValue:dummyString];// Display result
[TPS display];
sprintf(dummyString, "$%.2f", subtotal); // Convert float to a string
[SubTotal setStringValue:dummyString];// Display result
[SubTotal display];
sprintf(dummyString, "$%.2f", tvq); // Convert float to a string
[TVQ setStringValue:dummyString];// Display result
[TVQ display];
[Total selectText:self];
return self;
}
// AWAKEFROMNIB
// This is one of the last methods executed after the nib file is loaded.
// This is the BEST way I know how to initialize an object and jump into
// a method after the nib file was loaded, because you are all the methods
// and variables needed can be used. (Unlike init which is not compeletly
// ready when that message is sent
- awakeFromNib
{
[InversePanel makeKeyAndOrderFront:NULL];
[Total selectText:self];
return self;
}
@end